<?php

namespace app\common;

enum PayStatus: int
{
    case PAY_STATUS_SUCCESS = 1;
    case PAY_STATUS_FAILED = 2;
    case PAY_STATUS_WAITING = 3;
    case PAY_STATUS_REFUND = 4;

    public function getStatus(): string
    {
        return match ($this) {
            self::PAY_STATUS_SUCCESS => '支付成功',
            self::PAY_STATUS_FAILED  => '支付失败',
            self::PAY_STATUS_WAITING => '待支付',
            self::PAY_STATUS_REFUND  => '已退款',
        };
    }
}